package com.miplus.ccrm.core.controller;

import com.miplus.ccrm.common.R;
import com.miplus.ccrm.core.controller.vo.ncore.*;
import com.miplus.ccrm.core.service.ncore.NcCommand;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 2-13.新核心接口
 */
@Slf4j
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/ncc")
public class NewCoreController {

    /**
     * 暂记户查询 (dp2168)
     */
    @PostMapping("/searchTempAcct")
    public R<NcCmdResVo> searchTempAcct(@RequestBody @Validated TempSearchReqVo tempSearchReqVo){
        return R.Success(NcCommand.SearchTempRgstAcct(tempSearchReqVo));
    }

    /**
     * 存款账户信息查询 (dp2622)
     */
    @PostMapping("/searchDepAcctInf")
    public R<NcCmdResVo> searchDepAcctInf(@RequestBody @Validated AcctInfReqVo acctInfReqVo){
        return R.Success(NcCommand.SearchDepAcctInf(acctInfReqVo));
    }

    /**
     * 存款账户动帐明细历史查询 (dp2225)
     */
    @PostMapping("/searchDepAcctDetails")
    public R<NcCmdResVo> searchDepAcctDetails(@RequestBody @Validated AcctDetReqVo acctDetReqVo){
        return R.Success(NcCommand.SearchDepAcctDetails(acctDetReqVo));
    }

    /**
     * 存款暂记户开户 (dp2160)
     */
    @PostMapping("/tempRgstAcct")
    public R<NcCmdResVo> tempRgstAcct(@RequestBody @Validated TempRgstAcctReqVo tempRgstAcctReqVo){
        return R.Success(NcCommand.TempRgstAcct(tempRgstAcctReqVo));
    }

    /**
     * 通用记账接口 (id1239)TODO
     */
    @PostMapping("/bookKeeping")
    public R<NcCmdResVo> bookKeeping(@RequestBody @Validated TempRgstAcctReqVo tempRgstAcctReqVo){
        return R.Success();
    }
}
